package com.zmx.patients.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.patients.R;
import com.zmx.patients.pojo.PulseCondition;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 程序猿：胖胖祥
 * 时 间：2020/10/19  1:11
 * 功 能：
 */
public class PulseConditionListAdapter extends BaseAdapterRvList<PulseConditionListAdapter.ViewHolder, PulseCondition> {


    public PulseConditionListAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, PulseCondition pc) {

        holder.body.setText(pc.getHr());
        holder.time.setText(pc.getHrtime());

    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {

        PulseConditionListAdapter.ViewHolder holder = new PulseConditionListAdapter.ViewHolder(inflater.inflate(R.layout.adapter_body_list, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.time)
        TextView time;
        @BindView(R.id.body)
        TextView body;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }
}